var app = getApp();
Page({
    data:{
        curPage : "/zofui_sales/help/list",
        page : {
            isend : false,
            doing : false,
            doo : 'helpme',
            pdata : {
                op : 'list',
                page : 1,
            },
            waitf : 0,
            nodataf : 0,
        },
        datalist : [],
		siteroot : app.siteInfo.siteroot.replace('app/index.php', ''),uniacid: app.siteInfo.uniacid,
    },
    onLoad:function(options){
        var self = this;

        var zfid = options.zfid ? options.zfid : '';
        var type = options.type ? options.type : 0;
        self.setData({
            'page.pdata.zfid' : zfid,
            'page.pdata.type' : type,
        });
        
        app.com.getPage(self,self.data.page,20,function(res){
            var data = res.data.data;
            self.setData({
               datalist : data.list,
               Pagetheme : res.data.data.params.style,
               sharedata : res.data.data.sharedata,
            },function(){
                self.setData({
                    inited : true,
                });
            });

            wx.setNavigationBarTitle({
              title:  res.data.data.params.title ? res.data.data.params.title : '帮助中心',
            });

        },false,function(res){
            app.com.alert(res.data.message);
        });
    },
    onShareAppMessage : function(){
        var self = this;
        return {
            title: self.data.sharedata.title,
            path: self.data.sharedata.path,
            imageUrl : self.data.sharedata.img,
        }
    },
    onReachBottom : function(){
        var self = this;
        app.com.getPage(self,self.data.page,20,function(res){
            self.setData({
                datalist : self.data.datalist.concat(res.data.data.list)
            });
        });
    },
    location : function( e ){
        app.com.location( e );
    },
    footNavigate(e){
        var url = e.currentTarget.dataset.url;
        wx.switchTab({
          url: url
        })
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        wx.navigateTo({
            url : e.currentTarget.dataset.url
        });
    },
    redirectto : function( e ){
        app.com.redirectto( e);
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    toweburl : function(e){
        app.com.toweburl( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    }
    

})